#include "student.h"

void Student::setId(string _id)
{
    id=_id;
}


void Student::setName(string _name)
{
    name=_name;
}


void Student::print ()
{
    cout<<"学生信息"<<endl<<"学号："<<id<<endl<<"姓名："<<name<<endl;
}


void Student::save (string path)
{
    ofstream ofs;// 创建流对象
    ofs.open(path, ios::out | ios::app);

    ofs <<"学生信息："<<endl<<"学号："<<id<<endl<<"姓名："<<name<<endl;

    ofs.close();
}
